package com.ruoyi.college.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.college.mapper.FirstLevelSubjectMapper;
import com.ruoyi.college.domain.FirstLevelSubject;
import com.ruoyi.college.service.IFirstLevelSubjectService;

/**
 * 一级学科管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-30
 */
@Service
public class FirstLevelSubjectServiceImpl implements IFirstLevelSubjectService 
{
    @Autowired
    private FirstLevelSubjectMapper firstLevelSubjectMapper;

    /**
     * 查询一级学科管理
     * 
     * @param id 一级学科管理主键
     * @return 一级学科管理
     */
    @Override
    public FirstLevelSubject selectFirstLevelSubjectById(String id)
    {
        return firstLevelSubjectMapper.selectFirstLevelSubjectById(id);
    }

    /**
     * 查询一级学科管理列表
     * 
     * @param firstLevelSubject 一级学科管理
     * @return 一级学科管理
     */
    @Override
    public List<FirstLevelSubject> selectFirstLevelSubjectList(FirstLevelSubject firstLevelSubject)
    {
        return firstLevelSubjectMapper.selectFirstLevelSubjectList(firstLevelSubject);
    }

    /**
     * 新增一级学科管理
     * 
     * @param firstLevelSubject 一级学科管理
     * @return 结果
     */
    @Override
    public int insertFirstLevelSubject(FirstLevelSubject firstLevelSubject)
    {
        firstLevelSubject.setCreateTime(DateUtils.getNowDate());
        return firstLevelSubjectMapper.insertFirstLevelSubject(firstLevelSubject);
    }

    /**
     * 修改一级学科管理
     * 
     * @param firstLevelSubject 一级学科管理
     * @return 结果
     */
    @Override
    public int updateFirstLevelSubject(FirstLevelSubject firstLevelSubject)
    {
        firstLevelSubject.setUpdateTime(DateUtils.getNowDate());
        return firstLevelSubjectMapper.updateFirstLevelSubject(firstLevelSubject);
    }

    /**
     * 批量删除一级学科管理
     * 
     * @param ids 需要删除的一级学科管理主键
     * @return 结果
     */
    @Override
    public int deleteFirstLevelSubjectByIds(String[] ids)
    {
        return firstLevelSubjectMapper.deleteFirstLevelSubjectByIds(ids);
    }

    /**
     * 删除一级学科管理信息
     * 
     * @param id 一级学科管理主键
     * @return 结果
     */
    @Override
    public int deleteFirstLevelSubjectById(String id)
    {
        return firstLevelSubjectMapper.deleteFirstLevelSubjectById(id);
    }
    @Override
    public List<FirstLevelSubject> selectByFirstSubjectCode(String firstSubjectCode)
    {
        return firstLevelSubjectMapper.selectByFirstSubjectCode(firstSubjectCode);
    }

    /**
     * 根据一级学科代码获取一级学科信息
     *
     * @param firstSubjectCode 一级学科代码
     * @return 结果
     */

    @Override
    public FirstLevelSubject selectFirstLevelSubjectByFirstSubjectCode(String firstSubjectCode){return firstLevelSubjectMapper.selectFirstLevelSubjectByFirstSubjectCode(firstSubjectCode);}

    @Override
    public String selectFirstLevelSubjectNameByCollegeCode(String firstSubjectCode) {
        return firstLevelSubjectMapper.selectFirstLevelSubjectNameByCollegeCode(firstSubjectCode);
    }


}
